<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// +----------------------------------------------------------------------
// | Workerman设置 仅对 php think worker:gateway 指令有效
// +----------------------------------------------------------------------
return [
    // 扩展自身需要的配置
    'protocol'              => 'websocket', // 协议 支持 tcp udp unix http websocket text
    'host'                  => '0.0.0.0', // 监听地址
    'port'                  => env('workerman.port'), // 监听端口
    'socket'                => '', // 完整监听地址
    'transport'             => 'ssl',
    'context'               => [
        'ssl' => [
            // 请使用绝对路径
            'local_cert'  => env('workerman.local_cert'), // 也可以是crt文件
            'local_pk' => env('workerman.local_pk'),
            'verify_peer' => false,
        ]

    ], // socket 上下文选项
    'register_deploy'       => true, // 是否需要部署register
    'businessWorker_deploy' => true, // 是否需要部署businessWorker
    'gateway_deploy'        => true, // 是否需要部署gateway

    // Register配置
    'registerAddress'       => env('workerman.registerAddress'),

    // Gateway配置
    'name'                  => env('workerman.name'),
    'count'                 => env('workerman.count'),   //4核CPU
    'lanIp'                 => env('workerman.lanIp'),
    'startPort'             => env('workerman.startPort'),
    'daemonize'             => false,
    'pingInterval'          => 55,
    'pingNotResponseLimit'  => 1,
    'pingData'              => '{"type":"ping"}',

    // BusinsessWorker配置
    'businessWorker'        => [
        'name'         => env('workerman.business_worker_name'),
        'count'        => 1,
        'eventHandler' => 'app\http\controller\Events',
    ],

];
